package com.example.demo.controller;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Calendar;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 *
 * </P>
 *
 * @author mx
 * @date 2021-11-19 11:45
 */
public class MainTest {

    public static void main(String[] args) {

        System.out.println(LocalDate.now().plusMonths(-1));

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.add(Calendar.MONTH,-8);
        Date newTime = calendar.getTime();
        System.out.println(simpleDateFormat.format(newTime));
        System.out.println(System.currentTimeMillis());

    }



}